import requests

url = 'http://api.github.com/search/repositories?q=language:python&sort=stars'
r = requests.get(url)
print("status code:", r.status_code)

response_dict = r.json()
print('Total repositories:', response_dict['total_count'])

repo_dicts = response_dict['items']
print('Repositories returned:', len(repo_dicts))
#print('Incomplete_results:', response_dict['incomplete_results'])
print(response_dict.keys())
print('-'*70)
repo_dict = repo_dicts[0]
# print(repo_dict)
print('key:', len(repo_dict))
# for key in repo_dict.keys():
#     print(key)
print('项目名:', repo_dict['name'])
print('所有者:', repo_dict['owner']['login'])
print('星级:', repo_dict['stargazers_count'])
print('Repositories:', repo_dict['html_url'])
print('创建时间:', repo_dict['created_at'])
print('最后一次更新时间:', repo_dict['updated_at'])
print('Repositories 描述:', repo_dict['description'])


